Appendix D
Active Scripting Object Model
CONTENTS
This appendix summarizes the properties, events, and methods for
the objects in the Active Scripting Object Model.
The Active Scripting Object Model consists of the following objects:
- Window
- Frame
- History
- Navigator
- Location
- Script
- Document
- Link
- Anchor
- Form
See Appendix B, "HTML Intrinsic Controls: Properties, Events,
and Methods," for details of the Elements objects (also known
as Intrinsic HTML Controls).
Window Object Properties
- Name: Returns the name of the current window
- Parent: Returns a window object of the current
window's parent
- Self: Returns the window object of the current
window
- Top: Returns the window object of the topmost
window
- Location: Returns the Location object of
the current window
- Status: Gets or sets the text in the browser status
bar
- Frames: Returns the array of frames for the current
window
- History: Returns the History object for
the current window
- Navigator: Returns the Navigator object
for the current window
- Document: Returns the Document object for
the current window
Window Object Methods
- Alert: Displays a simple message box with exclamation
icon
- Confirm: Displays a message box containing Yes and
No buttons
- Prompt: Prompts the user for input
- Open: Creates a new window
- Close: Closes the current window
- SetTimeout: Sets a timer to call a function after
a specified number of milliseconds
- ClearTimeout: Clears the specified timer
- Navigate: Loads the resource at a URL
Window Object Events
- OnLoad: Fires when the contents of a window are loaded
- OnUnload: Fires when the contents of a window are
unloaded
The Frame object can be treated as another window. Therefore,
you can use the properties, methods, and events of the Window
object.
History Object Properties
- Length: Returns the number of items in the current
history list
History Object Methods
- Back: Moves back n
items in the history list
- Forward: Moves forward n
items in the history list
- Go: Moves to item n
in the history list
There are currently no History object events.
Navigator Object Properties
- appcodeName: Returns the code name of the browser
application
- appName: Returns the name of the browser application
- appVersion: Returns the version of the browser application
- userAgent: Returns the HTTP_USER_AGENT string
for the browser application
The Navigator object currently has no methods or events.
Location Object Properties
- href: Gets or sets the complete URL for the current
resource location
- protocol: Gets or sets the protocol section of the
URL
- host: Gets or sets the host and port of the URL
- hostname: Gets or sets the hostname section of the
URL
- port: Returns the port section of the URL
- pathname: Gets or sets the pathname section of the
URL
- search: Gets or sets the search portion (characters
following a question mark) of the URL
The Location object currently has no methods or events.
The Script object currently has no properties, methods, or events.
Document Object Properties
- linkColor: Gets or sets the color of the links
- aLinkColor: Gets or sets the color of the active
links
- vLinkColor: Gets or sets the color of the visited
links
- bgColor: Gets or sets the background color
- fgColor: Gets or sets the text (foreground) color
- anchors: Returns the array of anchors for the current
document
- links: Returns the array of links for the current
document
- forms: Returns the array of forms for the current
document
- location: Returns a read-only location object
- lastModified: Returns the date when the current document
was last saved
- title: Returns the document's title
- cookie: Gets or sets a cookie string for the current
document
- referrer: Gets the URL of the referring document
Document Object Methods
- write: Places a string into the document buffer
- writeLn: Has the same functionality as the write
method, but adds a line feed character to the end of the string
- open: Opens the document buffer
- Close: Closes the document buffer and writes the
contents of the buffer to the screen
The Document object currently has no events.
Link Object Properties
- length: Returns the number of links in the links
array
- href: Returns the complete URL for the link
- protocol: Returns the protocol section of the URL
- host: Returns the hostname and port for the URL
- hostname: Returns the hostname for the URL
- port: Returns the port for the URL
- pathname: Returns the pathname for the URL
- search: Returns the search portion of the URL
- target: Returns the window name for the target
The Link object currently has no methods.
Link Object Events
- mouseMove: Fires as the mouse arrow passes over the
link
- onMouseOver: Fires as the mouse arrow passes over
the link
- OnClick: Fires as the link is clicked
Anchor Object Properties
- name: Returns the name of the anchor
- count: Returns the number of anchors in the anchor
array
Form Object Properties
- action: Gets or sets the form action
- encoding: Gets or sets the form encoding
- method: Gets or sets the form method-either Get
or Post
- target:Gets or sets the name of the window to display
the form action (results)
- elements: Returns an array of elements within the
form
Form Object Methods
Form Object Events
- onSubmit: Fires immediately prior to submission of
the form